import { http } from '@/utils/http'

/**
 * 查询场地列表
 * @param
 */
export const getSiteListAPI = () => {
  return http({
    url: '/request/site/list',
  })
}

/**
 * 查询离场地的距离和场地列表
 * @param
 */
export const getSiteListDistanceAPI = (data) => {
  return http({
    url: '/request/site/listDistance',
    data
  })
}

/**
 * 获取场地详情
 * @param
 */
export const getSiteDetailAPI = (id) => {
  return http({
    url: `/request/site/${id}`,
  })
}

/**
 * 预约场地
 * @param
 */
export const siteReservationAPI = (data) => {
  return http({
    method: 'POST',
    url: `/request/site-reservation/reserve`,
    data
  })
}


/**
 * 通过场地id和预约日期查预约信息
 * @param
 */
export const getReservationAPI = (data) => {
  return http({
    url: `/request/site-reservation/byDate`,
    data
  })
}


